

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        String s = readKeyBoard(4);
        System.out.println(s);
    }


    private static String readKeyBoard(int limit) {
        String line = "";

        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()) {
            line = scanner.nextLine();
            if (line.length() < 1 || line.length() > limit) {
                System.out.print("输入长度（不大于" + limit + "）错误，请重新输入：");
                continue;
            }
            break;
        }

        return line;
    }
}
